package com.fdc_project.controller;


import com.fdc_project.entity.Customer;
import com.fdc_project.entity.Productinformation;
import com.fdc_project.entity.Staff;
import com.fdc_project.service.impl.StaffServiceImpl;
import com.fdc_project.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Sk
 * @since 2021-11-29
 */
@RestController
@RequestMapping("/staff")
public class StaffController {

    @Autowired
    StaffServiceImpl staffService;

    @PostMapping("/add")
    public Result CusAdd(@RequestBody Staff staff){return staffService.add(staff);}

    @PostMapping("/update")
    public Result CusUpdate(@RequestBody Staff staff){return staffService.update(staff);}

    @PostMapping("/delete")
    public Result CusDelete(Integer id){return staffService.delete(id);}

    @PostMapping("/selectone")
    public Result CusSelectOne(Integer id){return  staffService.selectone(id);};

    @PostMapping("/selectall")
    public Result CusSelectAll(){return staffService.selectcall();}

    @GetMapping("/selectmanager")
    public Result CusSelectManager(String manager){return staffService.SupervisorSelection(manager);}

}

